package com.geekarchitect.patterns.visitor.geek;

import com.geekarchitect.patterns.visitor.geek.v1.PPTFile;
import com.geekarchitect.patterns.visitor.geek.v1.PdfFile;
import com.geekarchitect.patterns.visitor.geek.v1.ResourceFile;
import com.geekarchitect.patterns.visitor.geek.v1.WordFile;
import com.geekarchitect.patterns.visitor.geek.v2.Extractor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Hongliang Zhu
 * @create 2023-01-07 21:06
 */
public class ToolApplication {
    public static void main(String[] args) {

        testV1();

    }
    private static void testV1() {
        List<ResourceFile> resourceFiles = listAllFiles("dir/");
        for (ResourceFile resourceFile : resourceFiles) {
            resourceFile.extract2txt();
        }
    }

    private static List<ResourceFile> listAllFiles(String dir) {
        List<ResourceFile> list = new ArrayList<>();
        list.add(new PPTFile("a.pdf"));
        list.add(new WordFile("b.word"));
        list.add(new PdfFile("c.pdf"));
        return list;

    }
}
